package com.xiaoli.mss.support;

/**
 * Http Restful 消息格式
 */
public class RestfulMessage<T> {
    public static final Integer CODE_VALID = 0;//http访问正常返回code
    public static final Integer CODE_INVALID = -1;//http访问异常返回code

    public static final String MSG_SUCCESS = "success";//http访问正常返回信息
    public static final String MSG_ERROR = "error";//http访问异常返回信息


    private Integer code; //业务自定义错误代码
    private String msg; //接口调用成功与否 success fail
    private T data; //接口调用返回数据

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public RestfulMessage(){}

    public RestfulMessage(Integer code,String msg,T data){
        this.setCode(code);
        this.setMsg(msg);
        this.setData(data);
    }
}
